<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use DB;

class LogController extends Controller
{

    /**
     * 指定当前数据表
     * @var string
     */
    public $table = 'system_log';


    /**
     * 日志列表
     */
    public function index() {
        $title = '系统操作日志';
        $actions = DB::table($this->table)->groupBy('action')->select('action')->get()->all();
        
        $db = DB::table($this->table)->orderBy('id','desc');
        // $get = $this->request->get();
        // foreach (['action', 'content', 'username'] as $key) {
        //     if (isset($get[$key]) && $get[$key] !== '') {
        //         $db->where($key, 'like', "%{$get[$key]}%");
        //     }
        // }
        return view('admin.log',compact('title', 'actions'));
    }

}
